REDIRECT_APPEND = >>
REDIRECT = >
REDIRECT_ERR = 2>
ECHO = echo
RM = rm -rf
HGCLONE = hg clone
MKDIR = mkdir -p
TEST_FILE = test -e
CAT = cat
HOSTNAME = hostname
LSCPU = lscpu
RSCRIPT = Rscript --vanilla
CP = cp
UP_F = $(shell $(ECHO) $(1) | tr a-z A-Z)

#FIXME Remove this duplication
TABLE_HEADER =Hostname,Architecture,Experiment Number,Benchmark,Barrier,Radix,Spinning,Threads Number,Nanoseconds per Barrier

HOST_NAME ?= $(shell $(HOSTNAME))

EXTRACFLAGS ?=
EXTRALDFLAGS ?=
TEST_RUNNER ?=
TEST_RUNNER_PASS_ARG_BEG ?=
TEST_RUNNER_PASS_ARG_END ?=
TEST_RUNNER_INIT ?=
TEST_RUNNER_FINI ?=

CPU_MAP_PRIORITY_DELTA ?= 1
CFLAGS += -DCPU_MAP_PRIORITY_DELTA=$(CPU_MAP_PRIORITY_DELTA)

CPUS_NUM ?= $(shell $(LSCPU) -p | grep -c -P '^\d')
CFLAGS += -DCPUS_NUM=$(CPUS_NUM)

ifeq ($(origin THREADS_SURPLUS), undefined)
    ifeq ($(origin THREADS_MAX_NUM), undefined)
        THREADS_SURPLUS = 2 
        THREADS_MAX_NUM = $(shell $(ECHO) $(CPUS_NUM) + $(THREADS_SURPLUS) | bc)
    else
        THREADS_SURPLUS = $(shell $(ECHO) $(THREADS_MAX_NUM) - $(CPUS_NUM) | bc)
    endif
else
    THREADS_MAX_NUM = $(shell $(ECHO) $(CPUS_NUM) + $(THREADS_SURPLUS) | bc)
endif

CEIL_LOG2_THREADS_MAX_NUM = $(shell printf %f `echo '(l($(THREADS_MAX_NUM) * 2 - l(2))/l(2))' | bc -l` | grep -P -o "^\d")
ifeq ($(CEIL_LOG2_THREADS_MAX_NUM),0)
CEIL_LOG2_THREADS_MAX_NUM = 1
endif
CFLAGS += -DTHREADS_MAX_NUM=$(THREADS_MAX_NUM)
CFLAGS += -DCEIL_LOG2_THREADS_MAX_NUM=$(CEIL_LOG2_THREADS_MAX_NUM)

BARRIERS_NUM ?= 1000000
CFLAGS += -DBARRIERS_NUM=$(BARRIERS_NUM)

EXPERIMENTS_NUM ?= 10
CFLAGS += -DEXPERIMENTS_NUM=$(EXPERIMENTS_NUM)

DEF_INTERPOLATE_RADIX = 1
CFLAGS += -DDEF_INTERPOLATE_RADIX=$(DEF_INTERPOLATE_RADIX)
ifeq ($(DEF_INTERPOLATE_RADIX), 1)
    INTERPOLATE_RADIX ?= yes
else
    INTERPOLATE_RADIX ?= no
endif

R_OPT_IGNORE_BARRIERS = ignoreBarriers=$(CHARTS_IGNORE_BARRIERS)
R_OPT_SUR_ONLY_SPINNINGS = surOnlySpinnings=$(CHARTS_SUR_ONLY_SPINNINGS)
R_OPT_INTERPOLATE_RADIX = interpolateRadix=$(INTERPOLATE_RADIX)

#FIXME: Cache coherency line size should be defined more precisely depending on MP architecture.
#       Default value was chosen due to X86 ISA 8.10.6.7 Place Locks and Semaphores in Aligned,
#       128-Byte Blocks of Memory
CCL_SIZE ?= 128
CFLAGS += -DCCL_SIZE=$(CCL_SIZE)

ARCH ?= $(shell arch)
DARCH = $(call UP_F, $(ARCH))
CFLAGS += -DARCH_$(DARCH)

CC ?= gcc
CXX ?= g++
CFLAGS += -O3 $(EXTRACFLAGS)
LDFLAGS = -lpthread -lrt $(EXTRALDFLAGS)

PATH_SEPARATOR = /
CFG_SEPARATOR = __
HEADER_EXT = .h
ERR_EXT = .err
BIN_EXT = .exe
TEST_REP_EXT = .csv
CFG_EXT = .cfg
BIN_DIR = bin
ROOT_TEST_REP_DIR = testrep
TEST_REP_DIR = $(ROOT_TEST_REP_DIR)$(PATH_SEPARATOR)$(HOST_NAME)
TEST_DB_FILENAME = test.db
TEST_DB_DIR = testdb
CHARTS_DIR = charts
GENCHARTS_SCRIPT = scripts/genchart.r

START_ID = 0
CURR_ID_FILE_NAME = .curr_exp_id

CURR_ID = $(shell $(TEST_FILE) $(TEST_REP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME) \
		         && $(CAT) $(TEST_REP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME))
ifeq ($(CURR_ID),)
CURR_ID = 0
endif
NEXT_ID = $(shell $(ECHO) $(CURR_ID) + 1 | bc)

ITP_BARRIERS_DIR = itpbarriers
ITP_BARRIERS_HEADERS_DIR = $(ITP_BARRIERS_DIR)$(PATH_SEPARATOR)c++$(PATH_SEPARATOR)barriers
ITP_BARRIERS_INCLUDE_DIR = $(ITP_BARRIERS_DIR)$(PATH_SEPARATOR)c++
ITP_REPO = https://code.google.com/p/barriers/
BIN_ITP_DIR = binitp
ROOT_TEST_REP_ITP_DIR = testrepitp
TEST_REP_ITP_DIR = $(ROOT_TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(HOST_NAME)
CURR_ITP_ID = $(shell $(TEST_FILE) $(TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME) \
                     && $(CAT) $(TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME))
ifeq ($(CURR_ITP_ID),)
CURR_ITP_ID = 0
endif
NEXT_ITP_ID = $(shell $(ECHO) $(CURR_ITP_ID) + 1 | bc)
DITPBARRIERS_FLAGS ?= -DNUM_PARTICIPANTS=$(THREADS_MAX_NUM) 
DITPBARRIERS_FLAGS += -DLOG2_NUM_PARTICIPANTS=$(CEIL_LOG2_THREADS_MAX_NUM) 
DITPBARRIERS_FLAGS += -DSKIP_REFERENCE_TIME=1 
DITPBARRIERS_FLAGS += -DDO_YIELD=0
DITPBARRIERS_FLAGS += -DUSE_TWO_PHASE=0
ITPBARRIERS = \
	DummyBarrier \
	SyncTreePhaser \
	SpinningCentralBarrier \
	SpinningCentralCASBarrier \
	SpinningCentralDBarrier \
	SpinningDisseminationBarrier \
	ConstSyncTreeBarrier
# The barriers below fail due to different reasons (not investigated):
#	HabaneroPhaser
#	ConstSpinningDisseminationBarrier


BARRIERS = \
	SR_BARRIER \
	DSMN_BARRIER \
	STNGS_BARRIER \
	STNLS_BARRIER \
	DTNGS_BARRIER \
	DTNLS_BARRIER \
	CTRGS_BARRIER \
	CTRLS_BARRIER
# Switched off being uncompetitive
# SNZI_BARRIER \
# PTHREAD_BARRIER
# Switched off but can be used for comparison
# OMP_BARRIER

SPINNINGS = \
	SPIN_SPINNING \
	PTYIELD_SPINNING \
	HWYIELD_SPINNING \
    PAUSE_SPINNING \
	WFE_SPINNING

HTM = \
	HLE_HTM \
	HTM_HTM \
	NHTM_HTM

BENCHMARKS = \
	PURE_BENCHMARK \
	LDIMBL_BENCHMARK \
	SANITY_BENCHMARK

SHORTEN_CFG_NAME_F = $(subst _BARRIER,, $(subst _SPINNING,, $(subst _BENCHMARK,, $(1))))

CFG_NAME_T = $(1)$(CFG_SEPARATOR)$(2)$(CFG_SEPARATOR)$(3)

BIN_NAME_F = $(call SHORTEN_CFG_NAME_F,$(BIN_DIR)$(PATH_SEPARATOR)$(CFG_NAME_T)$(BIN_EXT))

TEST_REP_NAME_F = $(call SHORTEN_CFG_NAME_F,$(TEST_REP_DIR)$(PATH_SEPARATOR)$(CFG_NAME_T)$(CFG_SEPARATOR)$(CURR_ID)$(TEST_REP_EXT))

TARGETS_BIN = \
$(foreach cbarrier, $(BARRIERS), \
	$(foreach spinning, $(SPINNINGS), \
		$(foreach benchmark, $(BENCHMARKS), \
			$(call BIN_NAME_F,$(cbarrier),$(spinning),$(benchmark)))))

TARGETS_TEST_REP = \
$(foreach cbarrier, $(BARRIERS), \
	$(foreach spinning, $(SPINNINGS), \
		$(foreach benchmark, $(BENCHMARKS), \
			$(call TEST_REP_NAME_F,$(cbarrier),$(spinning),$(benchmark)))))


CFG_ITP_NAME_T = $(1)$(CFG_SEPARATOR)$(2)

BIN_ITP_NAME_F = $(call SHORTEN_CFG_NAME_F,$(BIN_ITP_DIR)$(PATH_SEPARATOR)$(CFG_ITP_NAME_T)$(BIN_EXT))

TEST_REP_ITP_NAME_F = $(call SHORTEN_CFG_NAME_F,$(TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(CFG_ITP_NAME_T)$(CFG_SEPARATOR)$(CURR_ITP_ID)$(TEST_REP_EXT))

TARGETS_BIN_ITP = \
$(foreach itpbarrier, $(ITPBARRIERS), \
	$(foreach benchmark, $(BENCHMARKS), \
		$(call BIN_ITP_NAME_F,$(itpbarrier),$(benchmark))))

TARGETS_TEST_REP_ITP = \
$(foreach itpbarrier, $(ITPBARRIERS), \
	$(foreach benchmark, $(BENCHMARKS), \
		$(call TEST_REP_ITP_NAME_F,$(itpbarrier),$(benchmark))))


all : testall

buildall : builditp build

builditp : $(TARGETS_BIN_ITP)
$(TARGETS_BIN_ITP) : ITPBARRIER = $(word 1,$(subst $(CFG_SEPARATOR), ,$(subst $(BIN_EXT),,$(subst $(BIN_ITP_DIR)$(PATH_SEPARATOR),,$@))))
$(TARGETS_BIN_ITP) : HEADER_FILE = $(ITP_BARRIERS_HEADERS_DIR)$(PATH_SEPARATOR)$(ITPBARRIER)$(HEADER_EXT)
$(TARGETS_BIN_ITP) : CFLAGS += -include $(HEADER_FILE)
$(TARGETS_BIN_ITP) : CFLAGS += $(DITPBARRIERS_FLAGS)
$(TARGETS_BIN_ITP) : CFLAGS += -DITP_BARRIER
$(TARGETS_BIN_ITP) : CFLAGS += -I${ITP_BARRIERS_INCLUDE_DIR}
$(TARGETS_BIN_ITP) : cbarriers/barrier.c cbarriers/barrier.h $(HEADER_FILE) | $(ITP_BARRIERS_DIR) $(BIN_ITP_DIR)
	$(CXX) $(CFLAGS) cbarriers/barrier.c $(LDFLAGS) -o $@

build: $(TARGETS_BIN)

$(TARGETS_BIN) : BARRIER_SPINNING_BENCHMARK = $(subst $(CFG_SEPARATOR), ,$(subst $(BIN_EXT),,$(subst $(BIN_DIR)$(PATH_SEPARATOR),,$@)))
$(TARGETS_BIN) : DBARRIER = -D$(word 1,$(BARRIER_SPINNING_BENCHMARK))_BARRIER
$(TARGETS_BIN) : DSPINNING = -D$(word 2,$(BARRIER_SPINNING_BENCHMARK))_SPINNING
$(TARGETS_BIN) : DBENCHMARK = -D$(word 3,$(BARRIER_SPINNING_BENCHMARK))_BENCHMARK
$(TARGETS_BIN) : CFLAGS += $(DBARRIER) $(DSPINNING) $(DBENCHMARK)
$(TARGETS_BIN) : CFLAGS += $(subst OMP,-openmp,$(findstring OMP, $(word 1,$(BARRIER_SPINNING_BENCHMARK))))
$(TARGETS_BIN) : cbarriers/barrier.c cbarriers/barrier.h | $(BIN_DIR)
	$(CC) $(CFLAGS)	cbarriers/barrier.c $(LDFLAGS) -o $@

$(BIN_DIR) : | $(TEST_REP_DIR)
	$(MKDIR) $(BIN_DIR)
	$(ECHO) $(START_ID) $(REDIRECT) $(TEST_REP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME)

$(ITP_BARRIERS_DIR) :
	$(HGCLONE) $(ITP_REPO) $(ITP_BARRIERS_DIR)

$(BIN_ITP_DIR) : | $(TEST_REP_ITP_DIR)
	$(MKDIR) $(BIN_ITP_DIR)
	$(ECHO) $(START_ID) $(REDIRECT) $(TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME)

testall : testitp test

testitp : builditp $(TARGETS_TEST_REP_ITP)
	$(ECHO) $(NEXT_ITP_ID) $(REDIRECT) $(TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME)
	$(ECHO) "$(LSCPU):" $(REDIRECT) $(TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(HOST_NAME)$(CFG_SEPARATOR)$(ARCH)$(CFG_SEPARATOR)$(CURR_ITP_ID)$(CFG_EXT)
	$(LSCPU) $(REDIRECT_APPEND) $(TEST_REP_ITP_DIR)$(PATH_SEPARATOR)$(HOST_NAME)$(CFG_SEPARATOR)$(ARCH)$(CFG_SEPARATOR)$(CURR_ITP_ID)$(CFG_EXT)
	$(TEST_RUNNER_FINI)

$(TARGETS_TEST_REP_ITP) : ITPBARRIER = itp_$(word 1,$(subst $(CFG_SEPARATOR), ,$(subst $(TEST_REP_EXT),,$(subst $(TEST_REP_ITP_DIR)$(PATH_SEPARATOR),,$@))))
$(TARGETS_TEST_REP_ITP) : TEST_BIN = $(subst $(CFG_SEPARATOR)$(CURR_ITP_ID),,$(subst $(TEST_REP_EXT),$(BIN_EXT),$(subst $(TEST_REP_ITP_DIR),$(BIN_ITP_DIR),$@)))
$(TARGETS_TEST_REP_ITP) : | $(TEST_REP_ITP_DIR) testrunnerinit
	$(TEST_RUNNER) $(TEST_BIN) $(TEST_RUNNER_PASS_ARG_BEG) $(HOST_NAME) $(CURR_ITP_ID) $(INTERPOLATE_RADIX) $(ITPBARRIER) $(TEST_RUNNER_PASS_ARG_END) $(REDIRECT) $@ $(REDIRECT_ERR)$(subst $(TEST_REP_EXT),$(ERR_EXT),$@)

test : build $(TARGETS_TEST_REP)
	$(ECHO) $(NEXT_ID) $(REDIRECT) $(TEST_REP_DIR)$(PATH_SEPARATOR)$(CURR_ID_FILE_NAME)
	$(ECHO) "$(LSCPU):" $(REDIRECT) $(TEST_REP_DIR)$(PATH_SEPARATOR)$(HOST_NAME)$(CFG_SEPARATOR)$(ARCH)$(CFG_SEPARATOR)$(CURR_ID)$(CFG_EXT)
	$(LSCPU) $(REDIRECT_APPEND) $(TEST_REP_DIR)$(PATH_SEPARATOR)$(HOST_NAME)$(CFG_SEPARATOR)$(ARCH)$(CFG_SEPARATOR)$(CURR_ID)$(CFG_EXT)
	$(TEST_RUNNER_FINI)

$(TARGETS_TEST_REP) : TEST_BIN = $(subst $(CFG_SEPARATOR)$(CURR_ID),,$(subst $(TEST_REP_EXT),$(BIN_EXT),$(subst $(TEST_REP_DIR),$(BIN_DIR),$@)))
$(TARGETS_TEST_REP) : | $(TEST_REP_DIR) testrunnerinit
	$(TEST_RUNNER) $(TEST_BIN) $(TEST_RUNNER_PASS_ARG_BEG) $(HOST_NAME) $(CURR_ID) $(INTERPOLATE_RADIX) $(TEST_RUNNER_PASS_ARG_END) $(REDIRECT) $@ $(REDIRECT_ERR)$(subst $(TEST_REP_EXT),$(ERR_EXT),$@)

testrunnerinit:
	$(TEST_RUNNER_INIT)

$(TEST_REP_DIR) :
	$(MKDIR) $(TEST_REP_DIR)

$(TEST_REP_ITP_DIR) :
	$(MKDIR) $(TEST_REP_ITP_DIR)

cleanbuildtestall : clean cleanitp cleantestglob

clean : cleanbuild cleantest 

cleanbuild :
	$(RM) $(BIN_DIR)

cleantest :
	$(RM) $(TEST_REP_DIR)

cleanbuilditp :
	$(RM) $(BIN_ITP_DIR)

cleantestitp :
	$(RM) $(TEST_REP_ITP_DIR)

cleansrcitp :
	$(RM) $(ITP_BARRIERS_DIR)

cleantestglob :
	$(RM) $(ROOT_TEST_REP_DIR) $(ROOT_TEST_REP_ITP_DIR)

cleanitp : cleanbuilditp cleantestitp cleansrcitp

$(TEST_DB_DIR)$(PATH_SEPARATOR)$(TEST_DB_FILENAME) :
	$(MKDIR) $(TEST_DB_DIR)
	echo "$(TABLE_HEADER)" >> $(TEST_DB_DIR)$(PATH_SEPARATOR)$(TEST_DB_FILENAME)

createdbitp: | $(TEST_DB_DIR)$(PATH_SEPARATOR)$(TEST_DB_FILENAME)
	find $(ROOT_TEST_REP_ITP_DIR) -name *$(CFG_EXT) | xargs -i -t $(CP) {} $(TEST_DB_DIR)
	find $(ROOT_TEST_REP_ITP_DIR) -name *$(TEST_REP_EXT) | xargs -i -t sed -n '2,$${p;}' {} $(REDIRECT_APPEND) $(TEST_DB_DIR)$(PATH_SEPARATOR)$(TEST_DB_FILENAME)

createdb: | $(TEST_DB_DIR)$(PATH_SEPARATOR)$(TEST_DB_FILENAME)
	find $(ROOT_TEST_REP_DIR) -name *$(CFG_EXT) | xargs -i -t $(CP) {} $(TEST_DB_DIR)
	find $(ROOT_TEST_REP_DIR) -name *$(TEST_REP_EXT) | xargs -i -t sed -n '2,$${p;}' {} $(REDIRECT_APPEND) $(TEST_DB_DIR)$(PATH_SEPARATOR)$(TEST_DB_FILENAME)

createdball: cleandb createdb createdbitp

cleandb:
	$(RM) $(TEST_DB_DIR)

$(CHARTS_DIR):
	$(MKDIR) $(CHARTS_DIR)

gencharts: | $(CHARTS_DIR)
	$(RSCRIPT) $(GENCHARTS_SCRIPT) $(TEST_DB_DIR) $(CHARTS_DIR) $(THREADS_SURPLUS) $(R_OPT_IGNORE_BARRIERS) $(R_OPT_SUR_ONLY_SPINNINGS) $(R_OPT_INTERPOLATE_RADIX)

cleancharts:
	$(RM) $(CHARTS_DIR)

cleanall: cleanbuildtestall cleancharts cleandb

help :
	@echo "Usage: make <subcommand> [args]"
	@echo ""
	@echo "Availiable subcommands: help"
	@echo "                        testall test testitp"
	@echo "                        buildall build builditp"
	@echo "                        cleanbuildtestall cleanbuild cleantest cleanitp cleantestglob"
	@echo "                        cleanbuilditp cleantestitp cleansrcitp"
	@echo "                        createdball createdb createdpitp cleandb"
	@echo "                        gencharts cleancharts"
	@echo "                        cleanall"
	@echo ""
	@echo ""
	@echo "Availiable args [argname={valid values} (default) - description]:"
	@echo ""                                 
	@echo "  EXTRACFLAGS={...} ( ) - extra CFLAGS"
	@echo "  EXTRALDFLAGS={...} ( ) - extra LDFLAGS"
	@echo "  TEST_RUNNER={...} ( ) - test runner"
	@echo "  TEST_RUNNER_PASS_ARG_BEG={...} ( ) - option to begin passing args to test runner"
	@echo "  TEST_RUNNER_PASS_ARG_END={...} ( ) - option to end passing args to test runner"
	@echo "  TEST_RUNNER_INIT={...} ( ) - option to initialize test runner"
	@echo "  TEST_RUNNER_FINI={...} ( ) - option to finalize test runner"
	@echo ""                                 
	@echo "  CPUS_NUM={1..N} (shell nproc) - number of availiable CPUs"
	@echo "  THREADS_SURPLUS={(1-CPUS_NUM)..N} (2) - difference between the number of threads and cpus"
	@echo "  THREADS_MAX_NUM={1..N} (CPUS_NUM + THREADS_SURPLUS) - maximum numbewr of threads"
	@echo "                                                        (THREADS_SURPLUS has priority over THREADS_MAX_NUM if boths are defined)"
	@echo "  BARRIERS_NUM={1..N} (1000000) - number of barriers in experiment"
	@echo "  EXPERIMENTS_NUM={1..N} (10) - number of experiments"
	@echo "  CCL_SIZE={1..N} (128) - cache coherency line size"
	@echo "  ARCH={x86_64|armv7l} (shell arch) - target architecture"
	@echo "  HOST_NAME={...} (shell hostname) - target hostname"
	@echo "  CPU_MAP_PRIORITY_DELTA={1..CPUS_NUM} (1) - priority delta for mapping threads to cpus"
	@echo "  INTERPOLATE_RADIX={yes,no} (yes) - when number of threads participating in barrier is less than radix then the result is taken"
	@echo "                                     from experiment when number of threads participating in a barrier is equal to radix"
	@echo "  CHARTS_IGNORE_BARRIERS={sr,...,pthread} () - comma-separated list of barriers to ignore on charts"
	@echo "  CHARTS_SUR_ONLY_SPINNINGS={ptyield,...,hwyield} () - comma-separated list of spinning to be used on surplused charts"
	@echo ""
	@echo ""
	@echo "Recipies for different platmorms:"
	@echo ""
	@echo " Building for MIC:"
	@echo "  [mic]$$ make build CC=icc CPUS_NUM=240 THREADS_SURPLUS=2 EXTRACFLAGS=-mmic BARRIERS_NUM=10000 ARCH=mic CPU_MAP_PRIORITY_DELTA=4 HOST_NAME=mic0.`hostname`"
	@echo ""
	@echo " Running tests on MIC using 'micnativeloadex':"
	@echo "  [mic]$$ make test TEST_RUNNER=micnativeloadex TEST_RUNNER_PASS_ARG_BEG='-a \"' TEST_RUNNER_PASS_ARG_END='\"' HOST_NAME=mic0.`hostname`CC=icc CPUS_NUM=240 THREADS_SURPLUS=2 EXTRACFLAGS=-mmic BARRIERS_NUM=10000 ARCH=mic CPU_MAP_PRIORITY_DELTA=4"
	@echo ""
	@echo " Running tests on MIC using 'ssh':"
	@echo "  [mic]$$ make test TEST_RUNNER='ssh mic0 \"ulimit -s unlimited;' TEST_RUNNER_PASS_ARG_END='\"' HOST_NAME=mic0.`hostname` TEST_RUNNER_INIT='scp -r bin mic0:;ssh mic0 \"ulimit -s unlimited;./bin/SR__SPIN__PURE.exe\"' TEST_RUNNER_FINI='ssh mic0 \"rm -rf bin\"' CC=icc CPUS_NUM=240 THREADS_SURPLUS=2 EXTRACFLAGS=-mmic BARRIERS_NUM=10000 ARCH=mic CPU_MAP_PRIORITY_DELTA=4"
	@echo ""
	@echo ""

.PHONY: help test cleantest build cleanbuild install cleanall cleaninstall all cleanbuildtestall builditp testitp cleanitp cleantestglob createdball createdb createdpitp cleandb
.NOTPARALLEL:

